package com.googlecode.ozonbooksfinder.matefinder.events
{
	import com.googlecode.ozonbooksfinder.domain.Book;
	
	import flash.events.Event;

	public class BookDetailsEvent extends Event
	{
		public static const GET_ITEM_DETAIL:String = "getItemDetail";
		public static const GET_ITEM_INFO:String = "getItemInfo";
		
		public var book:Book;
		
		public function get bookId ():Number
		{
			if (book)
			{
				return book.id;
			}
			return NaN;
		}
		
		public function BookDetailsEvent(type:String, 
			bubbles:Boolean=true, cancelable:Boolean=false)
		{
			super(type, bubbles, cancelable);
		}
		
		override public function clone():Event
		{
			var result:BookDetailsEvent = 
				new BookDetailsEvent (type, bubbles, cancelable);
			result.book = book;
			return result;
		}
	}
}